package com.zhaoxiaodan.mibanddemo;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import com.zhaoxiaodan.miband.model.VibrationMode;

/**
 * Created by Tipray on 2016-02-22.
 */
public class AlarmBroadcastReceiver extends BroadcastReceiver  {
	private static final String TAG = "==[mibandtest]==";
	@Override
	   public void onReceive(Context context, Intent intent)
	   {

		   Log.i(TAG, "Receive alarm" );
		   if (intent.getAction().equals("com.android.deskclock.ALARM_ALERT")) {
			   Log.i(TAG,"ALARM_ALERT");
			   MainActivity.miband.startVibration(VibrationMode.VIBRATION_WITH_LED);
		    return;
	       }
		   //Intent i = new Intent(context, AlarmAlert.class);
		   //Bundle bundleRet = new Bundle();
		   //bundleRet.putString("STR_CALLER", "");
		   //i.putExtras(bundleRet);
		   //i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		   //context.startActivity(i);
	   }
}
